public class StatusPatternDemo {
    public static void main(String[] args) {
        Context context = new Context();

        // 此时context的状态就已经转换到了start
        Status startStatus = new StartStatus();
        startStatus.doAction(context);
        System.out.println(context.getStatus());

        // 此时context的状态就已经转换到了stop
        Status stopStatus = new StopStatus();
        stopStatus.doAction(context);
        System.out.println(context.getStatus());
    }
}
